package ttOrder.util;

import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Utils {
	
	

	public static void printValueByReflet(Object obj){
		String value = "";
		try {
			Field[] fields = obj.getClass().getDeclaredFields();
			for (Field field : fields) {
				field.setAccessible(true);  
				System.out.print("| "+field.getName()+" : "+field.get(obj)+" |"  );
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static void toPrintObj(Object obj){
		printValueByReflet(obj);
		System.out.println();
	}
	public static void toPrintList(List list){
		for (Object obj : list) {
			printValueByReflet(obj);
			System.out.println();
		}
	}
	
}
